import { axios } from '@/utils/request'

const root = '/im/hanyin/'

/**
 * 活动签到码列表
 */
export function actconfigList(params) {
  return axios({
    url: root + 'actconfig/list',
    method: 'get',
    params
  })
}

/**
 * 活动签到码新增
 */
export function actconfigAdd(data) {
  return axios({
    url: root + 'actconfig/add',
    method: 'post',
    data
  })
}

/**
 * 活动签到码编辑
 */
export function actconfigUpdate(data) {
  return axios({
    url: root + 'actconfig/update',
    method: 'post',
    data
  })
}

/**
 * 活动签到码删除
 */
export function actconfigDelete(data) {
  return axios({
    url: root + 'actconfig/delete',
    method: 'post',
    data
  })
}

/**
 * 签到码解绑、绑定设备
 */
export function deviceBind(data) {
  return axios({
    url: root + 'device/act/bind',
    method: 'post',
    data
  })
}

// 获取活动签到码
export function getActivitySignQrcode(id) {
  return axios({
    url: `/admin/activity/union/createActivitySignQrcode/${id}`,
    method: 'get',
  })
}
